<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box{
            overflow: hidden;
        }
        #con{
            border: 1px solid #000;
            height: 30px;
            white-space: nowrap;
            width:max-content;
        }
        .inner{
            float: left;
            height: 30px;
            line-height: 30px;
            width: 140px;
        }
    </style>
</head>
<body>
    
    <div class="box">
        <div id="con">
            <div class="inner">123</div>
            <div class="inner">456</div>
            <div class="inner">789</div>
        </div>
    </div>
</body>
</html>